package com.yh.service.impl;

import com.yh.common.DateUtil;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.common.message.MessageExt;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

/**
 * @author yh
 */
@Component
public class CustomMsgServiceImpl implements MessageListenerConcurrently {
    private static final Logger LOGGER = LoggerFactory.getLogger(OrderServiceImpl.class);
    @Override
    public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> list, ConsumeConcurrentlyContext consumeConcurrentlyContext) {
        LOGGER.info("时间="+ DateUtil.getTime(new Date())+"  接受消息成功" + list);
        return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
    }
}
